# Boost ThrowException Library test Jamfile
#
# Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
# Copyright 2019 Peter Dimov
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

import testing ;

project : requirements
  <warnings>extra
  <toolset>msvc:<warnings-as-errors>on
  <toolset>clang:<warnings-as-errors>on
  <toolset>gcc:<warnings-as-errors>on
  <toolset>gcc:<cxxflags>-Wshadow ;

run throw_exception_test.cpp ;
run throw_exception_no_exceptions_test.cpp ;
run throw_exception_no_integration_test.cpp ;
run throw_exception_no_both_test.cpp ;

compile-fail throw_exception_fail.cpp
  : <warnings-as-errors>off ;

run throw_exception_test2.cpp ;
run throw_exception_test3.cpp ;
run throw_exception_test4.cpp ;
run throw_exception_test5.cpp ;

lib lib1_throw : lib1_throw.cpp : <define>LIB1_SOURCE=1 <link>shared:<define>LIB1_DYN_LINK=1 : : <link>shared:<define>LIB1_DYN_LINK=1 ;
lib lib2_throw : lib2_throw.cpp : <define>LIB2_SOURCE=1 <link>shared:<define>LIB2_DYN_LINK=1 : : <link>shared:<define>LIB2_DYN_LINK=1 ;
lib lib3_throw : lib3_throw.cpp : <define>LIB3_SOURCE=1 <link>shared:<define>LIB3_DYN_LINK=1 : : <link>shared:<define>LIB3_DYN_LINK=1 ;
lib lib4_throw : lib4_throw.cpp : <define>LIB4_SOURCE=1 <link>shared:<define>LIB4_DYN_LINK=1 : : <link>shared:<define>LIB4_DYN_LINK=1 ;

run throw_from_library_test.cpp lib1_throw lib2_throw lib3_throw lib4_throw : : : <link>static : throw_from_library_static ;
run throw_from_library_test.cpp lib1_throw lib2_throw lib3_throw lib4_throw : : : <link>shared : throw_from_library_shared ;

run throw_exception_nx_test.cpp : : : <exception-handling>off ;
run throw_exception_nx_test2.cpp : : : <exception-handling>off ;
run throw_exception_nx_test3.cpp : : : <exception-handling>off ;

run make_exception_ptr_test.cpp ;
run make_exception_ptr_test2.cpp ;

run make_exception_ptr_nx_test.cpp : : : <exception-handling>off ;
run make_exception_ptr_nx_test2.cpp : : : <exception-handling>off ;

run throw_with_location_test.cpp ;
run throw_with_location_test2.cpp ;
run throw_with_location_test3.cpp ;
run throw_with_location_test4.cpp ;

run throw_with_location_nx_test.cpp : : : <exception-handling>off ;

run throw_with_location_test3.cpp : : : <rtti>off : throw_with_location_test3_nr ;
